import React from 'react';
import Classcard from './Classcard';
import { Checkbox,Icon } from 'antd-mobile';
import styles from './CartItem.css';
const CartItem = ({data,clickit})=>{
    return (
    <div className = {styles.cartitem}> 
        <div className = {styles.cartitemLeft}>
            <Checkbox 
                onChange = {(e)=>{clickit(e.target.checked,data)}}
            />
            <div className = {styles.itemhead}>
            <Classcard 
                bgpic = {data.startpic}
                ishead={0}
            />
            </div>
            <div className = {styles.itembody}>
                <span className = {styles.title}>
                {data.classname}
                </span>
                <span className = {styles.brief}>
                {data.brief}
                </span>
                <span className = {styles.price}>
                ￥{data.price}
                </span>
            </div>
        </div>

        <Icon type = "right" size = 'lg' className={styles.iconright}/>
    </div>
    );
}
export default CartItem;